home *** CD-ROM | disk | FTP | other *** search
/ Secrets of Stargate / STARGATE.iso / mac / STARGATE (5MB Macintosh) / STARGATE (5MB Macintosh).DXR / 00004_People Scripts.ls < prev    next >
Encoding:
Text File  |  1994-10-19  |  3.2 KB  |  111 lines

  1. on LoadPeopleCat theCat, sN
  2.   global gPeopleCategory, gPeopleRecs, gOnPC, gResourcePath
  3.   if voidp(sN) then
  4.     set sN to the clickOn
  5.   end if
  6.   hiliteAnim(sN, "P_")
  7.   if theCat = "Movie Credits" then
  8.     LinkTo("Movie Credits")
  9.   else
  10.     set gPeopleCategory to theCat
  11.     set theLine to LineOffset(gPeopleCategory, field "PEOPLE_C")
  12.     set gPeopleRecs to line theLine of field "PEOPLE_D"
  13.     delete item 1 of gPeopleRecs
  14.     createPeoplePopUps(theLine)
  15.     LinkPeopleFromIcon(1)
  16.   end if
  17. end
  18.  
  19. on LinkBackToPeopleCat
  20.   global gPeopleCategory
  21.   LinkTo("People Menu")
  22. end
  23.  
  24. on LinkPeopleFromIcon theSprite
  25.   global gPeopleCategory, gPeopleRecs, gIntroBack, gPeopleState, gOnPC, gResourcePath
  26.   spinCursor()
  27.   set numRecs to the number of items in gPeopleRecs
  28.   set curRecord to value(item theSprite of gPeopleRecs)
  29.   set theAB to line 4 of gPeopleState
  30.   if not (theAB = 1) then
  31.     set theAB to 1
  32.   else
  33.     set theAB to 0
  34.   end if
  35.   set gPeopleState to curRecord & RETURN & theSprite & RETURN & numRecs & RETURN & theAB
  36.   set sbTxtHdr to field "PEOPLE_0"
  37.   set numChunks to line 1 of sbTxtHdr
  38.   delete line 1 of sbTxtHdr
  39.   spinCursor()
  40.   repeat with z = 1 to the number of lines in sbTxtHdr
  41.     set sRec to word 1 of line z of sbTxtHdr
  42.     set eRec to word 2 of line z of sbTxtHdr
  43.     if (curRecord >= sRec) and (curRecord <= eRec) then
  44.       exit repeat
  45.     end if
  46.   end repeat
  47.   spinCursor()
  48.   set theLine to curRecord - sRec + 1
  49.   debug("R: " & curRecord)
  50.   set theData to line theLine of field ("PEOPLE_" & z)
  51.   set the itemDelimiter to "|"
  52.   spinCursor()
  53.   set the itemDelimiter to "|"
  54.   set thePerson to item 1 of theData
  55.   set theTitle to item 2 of theData
  56.   set theBio to putBackChars(item 3 of theData)
  57.   set portraitPICT to item 8 of theData
  58.   set the itemDelimiter to ","
  59.   spinCursor()
  60.   if not (portraitPICT = EMPTY) then
  61.     spinCursor()
  62.     if gOnPC then
  63.       set the fileName of cast ("PEOPLEHS.PIC" & theAB) to gResourcePath & "PEOPLE\" & portraitPICT
  64.     else
  65.       set the fileName of cast ("PEOPLEHS.PIC" & theAB) to "STARGATE:RESOURCE:PEOPLE:" & portraitPICT
  66.     end if
  67.   end if
  68.   spinCursor()
  69.   put thePerson & RETURN & theTitle into field ("Person Name" & theAB)
  70.   put theBio into field ("Person Bio" & theAB)
  71.   set newFrame to gPeopleCategory & " BG" & theAB
  72.   if the frame <> label(newFrame) then
  73.     LinkTo(newFrame)
  74.   end if
  75.   resetCursor()
  76. end
  77.  
  78. on prevPerson
  79.   global gIntroBack, gPeopleState, gPeopleCategory
  80.   set curRecord to value(line 1 of gPeopleState)
  81.   set curItem to value(line 2 of gPeopleState)
  82.   set maxItems to value(line 3 of gPeopleState)
  83.   if curItem = EMPTY then
  84.     set curItem to 1
  85.   else
  86.     if curItem = 1 then
  87.       set curItem to maxItems
  88.     else
  89.       set curItem to curItem - 1
  90.     end if
  91.   end if
  92.   LinkPeopleFromIcon(curItem)
  93. end
  94.  
  95. on nextPerson
  96.   global gIntroBack, gPeopleState, gPeopleCategory
  97.   set curRecord to value(line 1 of gPeopleState)
  98.   set curItem to value(line 2 of gPeopleState)
  99.   set maxItems to value(line 3 of gPeopleState)
  100.   if curItem = EMPTY then
  101.     set curItem to 1
  102.   else
  103.     if (curItem > maxItems) or (curItem = maxItems) then
  104.       set curItem to 1
  105.     else
  106.       set curItem to curItem + 1
  107.     end if
  108.   end if
  109.   LinkPeopleFromIcon(curItem)
  110. end
  111.